From fb49fb596a56955ca70eac9da47d2826299469e1 Mon Sep 17 00:00:00 2001
From: Mert Demir <mertd@users.noreply.github.com>
Date: Mon, 5 Feb 2024 02:23:11 +0900
Subject: Automatic category from expense title (#80)

* environment variable

* random category draft

* get category from ai

* input limit and documentation

* use watch

* use field.name

* prettier

* presigned upload, readme warning, category to string util

* prettier

* check whether feature is enabled

* use process.env

* improved prompt to return id only

* remove console.debug

* show loader

* share class name

* prettier

* use template literals

* rename format util

* prettier
---
 src/app/groups/[groupId]/expenses/create-from-receipt-button.tsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'src/app/groups/[groupId]/expenses/create-from-receipt-button.tsx')

diff --git a/src/app/groups/[groupId]/expenses/create-from-receipt-button.tsx b/src/app/groups/[groupId]/expenses/create-from-receipt-button.tsx
index d3f2bcf..b6df672 100644
--- a/src/app/groups/[groupId]/expenses/create-from-receipt-button.tsx
+++ b/src/app/groups/[groupId]/expenses/create-from-receipt-button.tsx
@@ -29,7 +29,7 @@ import { useMediaQuery } from '@/lib/hooks'
 import { formatExpenseDate } from '@/lib/utils'
 import { Category } from '@prisma/client'
 import { ChevronRight, FileQuestion, Loader2, Receipt } from 'lucide-react'
-import { getImageData, useS3Upload } from 'next-s3-upload'
+import { getImageData, usePresignedUpload } from 'next-s3-upload'
 import Image from 'next/image'
 import { useRouter } from 'next/navigation'
 import { PropsWithChildren, ReactNode, useState } from 'react'
@@ -46,7 +46,7 @@ export function CreateFromReceiptButton({
   categories,
 }: Props) {
   const [pending, setPending] = useState(false)
-  const { uploadToS3, FileInput, openFileDialog } = useS3Upload()
+  const { uploadToS3, FileInput, openFileDialog } = usePresignedUpload()
   const { toast } = useToast()
   const router = useRouter()
   const [receiptInfo, setReceiptInfo] = useState<
-- 
cgit v1.3

